import { http } from './service.js'

export const evaluateChildrenInfo = (childrenId) => {
	return http.request({
		url: '/eapi/operator/evaluateChildrenInfo',
		method: 'POST',
		params: {
			'childrenId': childrenId
		}
	})
}

export const addEvaluate = (params) => {
	return http.request({
		url: '/eapi/operator/add_evaluate',
		method: 'POST',
		params: params
	})
}

export const nextEvaluateItem = (recordId, resume, questionIdsStr, checkedsStr) => {
	return http.request({
		url: '/eapi/operator/next_evaluate_item_v2',
		method: 'POST',
		params: {
			'recordId': recordId,
		}
	})
}

export const getAssessDetail = (evaluateRecordId) => {
	return http.request({
		url: '/eapi/operator/detail',
		method: 'POST',
		params: {
			'evaluateRecordId': evaluateRecordId,
		}
	})
}

export const getChildrenReports = (params) => {
	return http.request({
		url: '/eapi/operator/children_reports',
		method: 'POST',
		params
	})
}

export const getBmiInfo = (params) => {
	return http.request({
		url: '/eapi/bmi/info',
		method: 'POST',
		params
	})
}


//家长端
//心里行为测评查询
export const evlPsycalList = () => {
	return http.request({
		url: '/wx/api/reports/pb/list',
		method: 'GET',
	})
}
export const evlPsycalDetail = (reportId) => {
	return http.request({
		url: '/wx/api/reports/pb/detail',
		method: 'GET',
		params: {
			'reportId': reportId,
		}
	})
}


//儿保查询
export const healthList = () => {
	return http.request({
		url: '/wx/api/reports/children_health/page',
		method: 'GET',
	})
}

export const healthDetail = (id) => {
	return http.request({
		url: '/wx/api/reports/children_health/detail',
		method: 'GET',
		params: {
			'id': id,
		}
	})
}


// 体测体测体测体测体测体测
export function addReport(data) {
  return http.request({
    url: '/peapi/evaluate/add_report',
    method: 'post',
	header: {
		'content-type': 'application/x-www-form-urlencoded'
	},
    data: data,
  })
}

export function getChildrenReportByPhysicle(params) {
  return http.request({
    url: '/peapi/evaluate/children_reports',
    method: 'get',
    params: params
  })
}

// 导出报告
export function evaluateExport(params) {
  return http.request({
    url: '/peapi/evaluate/export',
    method: 'get',
    params: params
  })
}

export function newRecord(classId) {
  return http.request({
    url: '/peapi/records/new_record',
    method: 'post',
    params: {
      classId: classId,
    }
  })
}

export function addRecordValues(data) {
  return http.request({
    url: '/peapi/evaluate/add_record_values',
    method: 'post',
    data,
  })
}

//查看班级草稿
export function draftRecord(classId) {
  return http.request({
    url: '/peapi/records/draft_record',
    method: 'post',
    params: {
      classId: classId,
    }
  })
}

export function finishDraft(recordId) {
  return http.request({
    url: '/peapi/records/finish_draft',
    method: 'post',
    params: {
      recordId: recordId,
    }
  })
}

export function deleteReport(reportId) {
  return http.request({
    url: '/peapi/evaluate/report',
    method: 'delete',
    params: {
      reportId: reportId
    }
  })
}

export function evaluateDetail(reportId) {
  return http.request({
    url: '/peapi/evaluate/detail',
    method: 'post',
    params: {
      reportId: reportId,
    }
  })
}


/**
 * 查询宝贝相册
 */
export function getPhotoAlbum(childrenId) {
  return http.request({
    url: '/pad/photo_album/album',
    method: 'get',
    params: {
      childrenId: childrenId,
    }
  })
}
